package com.example.chatchatbackend.entity.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 丁真
 * @since 2024-10-28 05:03:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("db_payment")
public class Payment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品id
     */
    private Integer productId;

    /**
     * 付款状态：0未付款 1已付款 2付款失败
     */
    private String paymentStatus;

    /**
     * 付款时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createdTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;

    private String productName;
    private Integer customerId;
    private String trackNumber;


    public Payment(Integer id, Integer productId, String paymentStatus, LocalDateTime createdTime, LocalDateTime updateTime, Integer customerId, String trackNumber) {
        this.id = id;
        this.productId = productId;
        this.paymentStatus = paymentStatus;
        this.createdTime = createdTime; // 赋值创建时间
        this.updateTime = updateTime; // 赋值更新时间
        this.customerId = customerId;
        this.trackNumber = trackNumber;
    }
}
